package br.com.assemble.hermeserp.model.pojos.enderecamento;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import br.com.assemble.hermeserp.ejb.annotation.DaoClass;
import br.com.assemble.hermeserp.model.BasePojo;
import br.com.assemble.hermeserp.model.pojos.comercial.Divisao;


/**
 * The persistent class for the BAIRROS database table.
 * 
 */
@Entity
@Table(name="BAIRROS")
@DaoClass(value="BairroDao", pu="hermes-pu")
public class Bairro extends BasePojo implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="BAI_IDENTIFY", unique=true, nullable=false)
	private BigInteger baiIdentify;

	@Column(name="BAI_NOME", nullable=false, length=100)
	private String baiNome;

	//bi-directional many-to-one association to Municipio
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="MUN_IDENTIFY", nullable=false)
	private Municipio municipio;

	//bi-directional many-to-one association to Divisao
	@OneToMany(mappedBy="bairro")
	private List<Divisao> divisaoCollection;

	//bi-directional many-to-one association to Enderecamento
	@OneToMany(mappedBy="bairro")
	private List<Enderecamento> enderecamentoCollection;

    public Bairro() {
    }

	public BigInteger getBaiIdentify() {
		return this.baiIdentify;
	}

	public void setBaiIdentify(BigInteger baiIdentify) {
		this.baiIdentify = baiIdentify;
	}

	public String getBaiNome() {
		return this.baiNome;
	}

	public void setBaiNome(String baiNome) {
		this.baiNome = baiNome;
	}

	public Municipio getMunicipio() {
		return this.municipio;
	}

	public void setMunicipio(Municipio municipio) {
		this.municipio = municipio;
	}
	
	public List<Divisao> getDivisaoCollection() {
		return this.divisaoCollection;
	}

	public void setDivisaoCollection(List<Divisao> divisaoCollection) {
		this.divisaoCollection = divisaoCollection;
	}
	
	public List<Enderecamento> getEnderecamentoCollection() {
		return this.enderecamentoCollection;
	}

	public void setEnderecamentoCollection(List<Enderecamento> enderecamentoCollection) {
		this.enderecamentoCollection = enderecamentoCollection;
	}
	
}